package lagern;

/**
 * Interface definition: Lager.
 * 
 * @author OpenORB Compiler
 */
public abstract class LagerPOA extends org.omg.PortableServer.Servant
        implements LagerOperations, org.omg.CORBA.portable.InvokeHandler
{
    public Lager _this()
    {
        return LagerHelper.narrow(_this_object());
    }

    public Lager _this(org.omg.CORBA.ORB orb)
    {
        return LagerHelper.narrow(_this_object(orb));
    }

    private static String [] _ids_list =
    {
        "IDL:lagern/Lager:1.0"
    };

    public String[] _all_interfaces(org.omg.PortableServer.POA poa, byte [] objectId)
    {
        return _ids_list;
    }

    public final org.omg.CORBA.portable.OutputStream _invoke(final String opName,
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler)
    {

        if (opName.equals("aktiviereMonitor")) {
                return _invoke_aktiviereMonitor(_is, handler);
        } else if (opName.equals("entferneMonitor")) {
                return _invoke_entferneMonitor(_is, handler);
        } else if (opName.equals("hole")) {
                return _invoke_hole(_is, handler);
        } else if (opName.equals("holeLagerListe")) {
                return _invoke_holeLagerListe(_is, handler);
        } else if (opName.equals("neu")) {
                return _invoke_neu(_is, handler);
        } else if (opName.equals("quit")) {
                return _invoke_quit(_is, handler);
        } else {
            throw new org.omg.CORBA.BAD_OPERATION(opName);
        }
    }

    // helper methods
    private org.omg.CORBA.portable.OutputStream _invoke_neu(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        String arg1_in = _is.read_string();

        try
        {
            lagern.Fach _arg_result = neu(arg0_in, arg1_in);

            _output = handler.createReply();
            lagern.FachHelper.write(_output,_arg_result);

        }
        catch (lagern.LagerPackage.exAlreadyExists _exception)
        {
            _output = handler.createExceptionReply();
            lagern.LagerPackage.exAlreadyExistsHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_hole(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        String arg0_in = _is.read_string();
        String arg1_in = _is.read_string();

        try
        {
            lagern.Fach _arg_result = hole(arg0_in, arg1_in);

            _output = handler.createReply();
            lagern.FachHelper.write(_output,_arg_result);

        }
        catch (lagern.LagerPackage.exNotFound _exception)
        {
            _output = handler.createExceptionReply();
            lagern.LagerPackage.exNotFoundHelper.write(_output,_exception);
        }
        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_holeLagerListe(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        lagern.Fach[] _arg_result = holeLagerListe();

        _output = handler.createReply();
        lagern.FachListeHelper.write(_output,_arg_result);

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_aktiviereMonitor(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        lagern.Monitor arg0_in = lagern.MonitorHelper.read(_is);

        aktiviereMonitor(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_entferneMonitor(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;
        lagern.Monitor arg0_in = lagern.MonitorHelper.read(_is);

        entferneMonitor(arg0_in);

        _output = handler.createReply();

        return _output;
    }

    private org.omg.CORBA.portable.OutputStream _invoke_quit(
            final org.omg.CORBA.portable.InputStream _is,
            final org.omg.CORBA.portable.ResponseHandler handler) {
        org.omg.CORBA.portable.OutputStream _output;

        quit();

        _output = handler.createReply();

        return _output;
    }

}
